<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<?php session_start();
//TO get coupon information
$temp=$_SESSION['Coupon'];
$coup=sprintf("%1\$.2f",$temp);
//To know login information
$CheckEmail=$_POST['useremail'];
$_SESSION['UserPWD']=md5($_POST['userpwd']);
$_SESSION['Username']=$_POST['useremail'];
$USERNAME=$_POST['useremail'];
$PASSWORD=md5($_POST['userpwd']);

if(!isset($_SESSION['Username']))
{echo "Your username (email address) is not stored in our system, please start your ". "<a href='apply.php'>application here</a> now, thank you for your cooperation!";
exit();
}

$link = mysql_connect('cash2uca.ipagemysql.com', 'cash2uca', 'actW3740!@#$'); 
if (!$link) { 
    die('Could not connect: ' . mysql_error()); 
} 
mysql_select_db(cash2uca); 

//To pull out login information
$SQL="SELECT UserName,UserPWD,ProfileID FROM `MainTable` WHERE UserName = '$USERNAME' and UserPWD='$PASSWORD'";
$LoginID=mysql_query($SQL);
$rows = mysql_fetch_array($LoginID);
if (mysql_num_rows($LoginID)!= 1) { 
echo mysql_num_rows($LoginID)."<br/>";
echo $USERNAME."<br/>";
echo md5(12345678)."<br/>";
 echo "login failed"; 
 include "member.php"; 
 exit();
} 
else { 
$_SESSION['IP'] = $_SERVER['REMOTE_ADDR']; 
$_SESSION['ProfileID'] = $rows['ProfileID'];
}

//To pull out personal information

$link = mysql_connect('cash2uca.ipagemysql.com', 'cash2uca', 'actW3740!@#$'); 
if (!$link) { 
    die('Could not connect: ' . mysql_error()); 
} 
mysql_select_db(cash2uca); //46 lines
$sqlP = "SELECT FirstName , LastName FROM `Profiles` WHERE ProfileID= '".$_SESSION['ProfileID']."'";//50
$sqlpresult=mysql_query($sqlP);
$rowp = mysql_fetch_array($sqlpresult);
$_SESSION['firstname']=$rowp['FirstName'];
$_SESSION['lastname']=$rowp['LastName'];

//To determine number of visits//53 lines
$sqlvisits="SELECT COUNT(*) as Nums FROM `Applications` WHERE ProfileID='".$_SESSION['ProfileID']."'";
$sqlnums=mysql_query($sqlvisits);
$rownum = mysql_fetch_array($sqlnums);
$_SESSION['novisits']=$rownum['Nums'];//60


//TO retrieve banking information
$sqlbanking="SELECT BankName, DebitID, DebitPWD, SQ1, AS1, SQ2, AS2, SQ3, AS3, Employer, EAddress, ECity, EProvince, EPhone, EPost, DateHired, JobStatus, Occupation,PayType, PayFrequency, FirstPayDay, SecondPayDay, OtherIncome, MonthlyIncome, PayBy, TransitID, InstitutionID, CheckID FROM Applications WHERE ProfileID= ".$_SESSION['ProfileID']." AND NumberofVisits=".$_SESSION['novisits'];
$sqlbankingresult=mysql_query($sqlbanking);
$rowbanking = mysql_fetch_array($sqlbankingresult);
$_SESSION['BankName']=$rowbanking['BankName'];
$_SESSION['DebitID']=$rowbanking['DebitID'];
$_SESSION['DebitPWD']=$rowbanking['DebitPWD'];
$_SESSION['SQ1']=$rowbanking['SQ1'];//70
$_SESSION['AS1']=$rowbanking['AS1'];
$_SESSION['SQ2']=$rowbanking['SQ2'];
$_SESSION['AS2']=$rowbanking['AS2'];
$_SESSION['SQ3']=$rowbanking['SQ3'];
$_SESSION['Employer']=$rowbanking['Employer'];
$_SESSION['EAddress']=$rowbanking['EAddress'];
$_SESSION['ECity']=$rowbanking['ECity'];
$_SESSION['EProvince']=$rowbanking['EProvince'];
$_SESSION['EPhone']=$rowbanking['EPhone'];
$_SESSION['EPost']=$rowbanking['EPost'];//80
$_SESSION['DateHired']=$rowbanking['DateHired'];
$_SESSION['JobStatus']=$rowbanking['JobStatus'];
$_SESSION['Occupation']=$rowbanking['Occupation'];
$_SESSION['PayType']=$rowbanking['PayType'];
$_SESSION['PayFrequency']=$rowbanking['PayFrequency'];
$_SESSION['FirstPayDay']=$rowbanking['FirstPayDay'];
$_SESSION['SecondPayDay']=$rowbanking['SecondPayDay'];
$_SESSION['OtherIncome']=$rowbanking['OtherIncome'];
$_SESSION['MonthlyIncome']=$rowbanking['MonthlyIncome'];
$_SESSION['PayBy']=$rowbanking['PayBy'];
$_SESSION['TransitID']=$rowbanking['TransitID'];
$_SESSION['InstitutionID']=$rowbanking['InstitutionID'];
$_SESSION['CheckID']=$rowbanking['CheckID'];

mysql_close($link)
?>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Cash2u.ca: Payday loan online application for Canadians</title>
<META NAME="Keywords" CONTENT="payday loan, payday cash advance, online, payday advance, payday cash loan, payday loans, cash advance, paycheque loans, short term,
	money mart, money here, quick cash,check,cashing,easy,tax, bill,payment,currency,card,credit,Easy Cash Advances, Internet Payday loans, Payroll Advance, Payday Loan Services,
	Online Payday Advances, Online Payday Loan Provider, Pay Day, Canada">
<META NAME="Description" CONTENT=Cash2u.ca offers online payday loans and cash advance for Canadians">

<script type="text/javascript" src="http://ajax.microsoft.com/ajax/jquery/jquery-1.4.2.min.js"></script>
<script src="./css/jquery.maskedinput.js" type="text/javascript"></script>
<script type="text/javascript" src="calendarDateInput.js">
/***********************************************
* Jason's Date Input Calendar- By Jason Moon http://calendar.moonscript.com/dateinput.cfm
* Script featured on and available at http://www.dynamicdrive.com
* Keep this notice intact for use.
***********************************************/
</script>
<link rel="stylesheet" type="text/css" href="./css/main_style.css"/>
<script type="text/javascript" src="validationjava.js"></script>
<script src="formavalidates.js" type="text/javascript"></script> 
<script type="text/javascript" src="./css/mathematics.js">
</script>
</head>
<body onload="DoMath()">
<div id="maincontainer">

<div id="topsection"><h1><a class="innertube" href="apply.php">Cash to You Now</a></h1></div>

<table cellspacing="4" cellpadding="1" border="0" style="margin:5px;height:50px;width:740px;background-color:#f0f0f0;border:1px solid #e5e5e5;color:#666666;font-size:110%;font-weight:bold;">
	<tr><td width="20"></td>
        	<td width="90" align="center"><a href="index.html">HOME</a></td>
                <td width="90" align="center"><a href="apply.php">APPLY</a></td>
                <td width="130" align="center"><a href="member.php"><span class="displace">MEMBERS</span></a></td>
        	<td width="110" align="center"><a href="policy.php"><span class="displace">POLICY</span></a></td>
        	<td width="90" align="center"><a href="faqs.php"><span class="displace">FAQ's</span></a></td>
        	<td width="90" align="center"><a href="contact.php"><span class="displace">CONTACT</span></a></td>
		<td width="140"></td>
	</tr>
</table>

<div id="content">
    	<div id="Apphead" class="Apphead" style="margin: 20px 0 0 5px;">
        	<h3>LOAN APPLICATION</h3>
		<p>Please check your information below and correct it if error found or your information has changed</p>      
    	</div>
        <!-- EOD of Application Head -->    
          
        <div id="TopSectionWrapper" class="PersonalInfo">
		<div id="NewCust" class="NewCust"><?php echo $_SESSION['ProfileID'];?>Existing <?php echo $_SESSION['novisits'];?> Customer Application <?php echo $_SESSION['BankName'];?></div>

	<!--Starting of Personal Information Section-->
	<div id="TitleInfo" class="TitleInfo"><h2>Your Personal Information</h2></div>
	<form name="SecondProfiles" method="post" action="submitapplication.php">
	<table cellspacing="4" cellpadding="1" border="0" style="margin: 0 0 0 0;">
		<tr>
                <td width="140" align="right">First Name:</td>
                <td width="170"><input type="text" style="width: 150px;" value="<?php echo $_SESSION['firstname'];?>" name="Efirstname"></td>
                <td width="230" align="right">Last Name:</td>
                <td width="160"><input type="text" style="width: 150px;" name="Elastname" value="<?php echo $_SESSION['lastname'];?>"></td>
		</tr>
		
		<tr>
                <td width="140" align="right">Email Address:</td>
                <td width="170"><input type="text" name="eemail" style="width: 150px;"/></td>
                <td width="230" align="right">Social Insurance Number:<br/><span style="color:green;font-size:small;">(SIN: 999-999-999)</span></td>
                <td width="160"><input type="text" style="width: 150px;" id="essn" name="eSIN" value=""></td>
		</tr>


		<tr>
                <td width="140" align="right">First Pay Date:<br/><span style="color:green;font-size:small;">(date: mm/dd/yyyy)</span></td>
                <td width="170"><input type="text" id="efdate" name="efirstpayday" style="width: 150px;" value="" onchange="DoMath()"></td>			
                <td width="230" align="right">Second Pay Date:<br/><span style="color:green;font-size:small;">(date: mm/dd/yyyy)</span></td>
                <td width="160"><input type="text" id="esdate"  name="esecondpayday" style="width: 150px;"/></td>
		</tr>

			
		<tr>
                <td width="140" align="right">Bank Name:</td>
                <td width="170">
			<select style="width: 160px;" name="ebankname" value="<?php echo $_SESSION['BankName'];?>">
					<option value="">- Select -</option>
					<option value="BMO" >Bank of Montreal</option>
					<option value="CIBC" >CIBC</option>
					<option value="HSBC" >HSBC Bank Canada</option>//190
					<option value="NationalBank" >National Bank of Canada</option>
				        <option value="RBC">Royal Bank of Canada</option>
					<option value="Scotiabank" >Scotiabank</option>
				        <option value="TDBank">TD Canada Trust</option>
					<option value="NonBank">Other Banks</option>
			</select></td>
                <td width="230" align="right">Branch Transit Number:</td>
                <td width="160"><input type="text" name="etransitnumber" style="width: 150px;" value="" maxlength="5"></td>
		</tr>

		<tr>
                <td width="140" align="right">Financial Institution Number:</td>
                <td width="170"><input type="text" name="einstitutionnumber" style="width: 150px;" maxlength="3"/></td>
                <td width="230" align="right">Checking Account Number:</td>
                <td width="160"><input type="text" name="echeckingnumber" style="width: 150px;" value="" maxlength="12"></td>
		</tr>

	</table>	
		

	<table cellspacing="4" cellpadding="1" border="0" style="border:solid green;margin:5px;padding:5px;">
		<tr>
                	<td width="350"><img src="/images/Canadian-Cheque.jpg" /></td>
        	        <td width="350"><ol>
	<li>"12345"-This is 5-digit branch transist number</li>
	<li>"999"-This is 3-digit financial institution number</li>
	<li>"456789012"-This is chequeing account number</li>
	</ol></td>
		</tr>


	<table cellspacing="4" cellpadding="1" border="0" style="margin: 0 0 0 0;color:black;">
		<tr>
		<td width="700" align="left" style="border:solid;">
                No Faxing required! Online banking will help establish the credit-worthiness of the member and online banking will make us easily verify your employment and increase your loan process dramatically</td>
                </tr>
	</table>

	<table cellspacing="4" cellpadding="1" border="0" style="margin: 0 0 0 0;">
		<tr>
                <td width="140" align="right">Debit Card Number:</td>
                <td width="170"><input type="text" style="width: 150px;" value="<?php echo $_SESSION['DebitID'];?>" name="edebitnumber"></td>
                <td width="230" align="right">Online banking password:</td>
                <td width="160"><input type="text" style="width: 150px;" name="edpwd" value=""></td>
		</tr>

		<tr>
                <td width="140" align="right">Security Question #1<br/><span style="color:green;font-size:small;">(if have):</span></td>
                <td width="170"><input type="text" style="width: 150px;" value="" name="esq1"></td>
                <td width="230" align="right">Answer #1:</td>
                <td width="160"><input type="text" style="width: 150px;" name="eas1" value=""></td>
		</tr>


		<tr>
                <td width="140" align="right">Security Question #2<br/><span style="color:green;font-size:small;">(if have):</span></td>
                <td width="170"><input type="text" style="width: 150px;" value="" name="esq2"></td>
                <td width="230" align="right">Answer #2:</td>
                <td width="160"><input type="text" style="width: 150px;" name="eas2" value=""></td>
		</tr>
<tr>
                <td width="140" align="right">Security Question #3<br/><span style="color:green;font-size:small;">(if have):</span></td>
                <td width="170"><input type="text" style="width: 150px;" value="" name="esq3"></td>
                <td width="230" align="right">Answer #3:</td>
                <td width="160"><input type="text" style="width: 150px;" name="eas3" value=""></td>
		</tr>
		
	</table>

	<table cellspacing="4" cellpadding="1" border="0" style="margin: 0 0 0 0;color:black;">
		<tr>
		<td width="700" align="left">
                Since this is your <span style="color:green;"><?php echo $_SESSION['novisits']+1;
if($_SESSION['novisits']==1){echo nd;} else if($_SESSION['novisits']==2){echo rd;} else{th;} ?></span> time loan application, according to our policy, your maximum loan amount is  <span style="color:green;"><?php if($_SESSION['novisits']==1){echo "$150";} else if($_SESSION['novisits']==2){echo "$200";} else if($_SESSION['novisits']==3){echo "$300";} else if($_SESSION['novisits']==4){echo "$400";} else if($_SESSION['novisits']==5){echo "$500";} else {echo "$600";} ?></span></td>
                </tr>
	</table>
	
	<table cellspacing="4" cellpadding="1" border="0" style="margin: 0 0 0 0;">
		<tr>
                <td width="140" align="right">I want to borrow:</td>
                <td width="170">
			<select style="width: 160px;" name="loanborrow" onchange="DoMath()">
					<option value="0">- Select -</option>
					<option value="50" >50</option>
					<option value="100" >100</option>
			</select></td>
                <td width="230" align="right">Loan cost:</td>
                <td width="160"><input type="text" style="width: 150px;" name="loancost" readonly value="" id="cost"></td>
		</tr>
	</table>
	<table>
		<tr>
                <td width="170"><input type="text" name="coup" style="visibility:hidden;" value="<?php echo $coup;?>"/></td>
                <td width="230"><input type="text" name="hcost" style="visibility:hidden;" /></td>
                <td width="160"></td>
		</tr>

	</table>

	<table cellspacing="4" cellpadding="1" border="0" style="margin: 0 0 0 0;">
		<tr>
		<td width="740" align="left" style="font-size:strong;color:black;">
		Please read the following agreement carefully before you sign
		</td></tr>
		<tr>
		<td width="740" align="center">
		<iframe src="policy.php" frameborder="0" style="width:720px;height:150px;position:relative;left:5px;"></iframe>
		</td>
		</tr>
		<tr>
		<td width="740" align="left"><input type="checkbox" name="signoff" value="yes"/>I have read and agree to all terms and conditions of the Loan Agreement, and I also authorize
	Cash2u.ca to verify the accuracy of this information by, among other actions, calling a phone number provided by me. Here signed electronically
		</td>
		</tr>

	</table>


	<table cellspacing="4" cellpadding="1" border="0" style="margin: 0 0 0 0;">
	<tr><td width="700" align="center"><input type="submit" value=" &nbsp;Submit"/></td>
	</tr>
	</table>

	</form>

	<script type="text/javascript">
var frmvalidator  = new Validator("SecondProfiles");  
frmvalidator.addValidation("employer","req","Please enter your company name");
frmvalidator.addValidation("eaddress","req","Please enter your company's address");
frmvalidator.addValidation("ecity","req","Please enter the city where your company is");
frmvalidator.addValidation("eprovince","req","Please select the province where your company resides");
frmvalidator.addValidation("ephone","req","Please enter your company's phone number in case we need verify your information");
frmvalidator.addValidation("eemail","req","Please enter your email address and your email address will be your loginID when you come back, Thanks!");
frmvalidator.addValidation("eemail","email", "The email address is not a correct email format");
frmvalidator.addValidation("epost","req","Please enter your company's post code");
frmvalidator.addValidation("JobStatus","req","Please select your job status");
frmvalidator.addValidation("datehired","req","Please tell us when you got this job?");
frmvalidator.addValidation("paytype","req","Please choose your pay type");
frmvalidator.addValidation("payperiod","req","Please choose your pay period");
frmvalidator.addValidation("firstpayday","req","Please indicate your next pay date");
frmvalidator.addValidation("secondpayday","req","Please indicate your second pay date after your next pay date");
frmvalidator.addValidation("payby","req","Do you pay by direct deposit? Please tell us, thanks");
frmvalidator.addValidation("totalincome","req","Please tell us how much you get for your each pay period");
frmvalidator.addValidation("bankname","req","Please choose your bank name");
frmvalidator.addValidation("transitnumber","req", "Please enter your branch transit number, see sample below");
frmvalidator.addValidation("transitnumber","maxlen=5","Max length for branch transit number is 5");  
frmvalidator.addValidation("institutionnumber","req","Please enter your financial institution number, see sample below"); 
frmvalidator.addValidation("institutionnumber","maxlen=3","Max length for financial institution number is 3"); 
frmvalidator.addValidation("checkingnumber","req","Please enter your checking account number, see sample below");
frmvalidator.addValidation("checkingnumber","maxlen=12","Max length for your checking account number is 12");
frmvalidator.addValidation("debitnumber","req","Please enter your debit card number");
frmvalidator.addValidation("dpwd","req","Please enter your online password, thanks");
frmvalidator.addValidation("loanborrow","req","Please choose how much you want to borrow");
frmvalidator.addValidation("signoff","shouldselchk=yes","Please sign off");
</script>

<div id="footer">
<div id="imlinks"><b><strong>Copyright ?2011 Cash2u.ca All rights reserved</strong></b></div>
</div>

</div>

<!--JQuery functions here-->
<script type="text/javascript">/*<![CDATA[*/// 
   jQuery(function($) {
      $.mask.definitions['~']='[+-]';
      $('#date').mask('99/99/9999');
      $('#datebirth').mask('99/99/9999');
      $('#datein').mask('99/99/9999');
      $('#datehired').mask('99/99/9999');
      $('#fdate').mask('99/99/9999');
      $('#efdate').mask('99/99/9999');
      $('#sdate').mask('99/99/9999');
      $('#esdate').mask('99/99/9999');
      $('#phone').mask('(999) 999-9999');
      $('#phonep').mask('(999) 999-9999');
      $('#phonew').mask("(999) 999-9999? x99999");
      $('#phonec').mask('(999) 999-9999');
      $('#phoner1').mask("(999) 999-9999? x99999");
      $('#phoner2').mask("(999) 999-9999? x99999");
      $('#phoneext').mask("(999) 999-9999? x99999");
      $("#tin").mask("99-9999999");
      $("#ssn").mask("999-999-999");
      $("#essn").mask("999-999-999");
      $("#post").mask("a9a-9a9");
      $("#epost").mask("a9a-9a9");
      $("#product").mask("a*-999-a999",{placeholder:" ",completed:function(){alert("You typed the following: "+this.val());}});
      $("#eyescript").mask("~9.99 ~9.99 999");
   });
// ]]&gt;/*]]>*/</script> 


<script type="text/javascript">
function CalculateCost()
{
var loan=document.getElementById("loanborrow");
document.getElementById("cost")=loan*21;
}
</script>
</body>
</html>





























